package com.kede.api.stand.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.kede.api.stand.domain.Virtual;
import com.kede.api.stand.mapper.VirtualMapper;
import com.kede.pojo.ResHttp;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 独立服务
 *
 * @author 11856
 * @date 2023/06/12
 */
@RestController
public class VirtualController {

    @Resource
    private VirtualMapper virtualMapper;

    /**
     * 随机获取置换数
     *
     * @Author: Pr.li
     * @Date: 2023/4/12 15:30
     * @Param: []
     * @Return: com.kede.api.pojo.ResHttp
     ***/
    @GetMapping("getRandomZHnum")
    public ResHttp getRandomZh(String name){
        LambdaQueryWrapper<Virtual> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Virtual::getName,name);
        Virtual virtual = virtualMapper.selectOne(queryWrapper);
        return ResHttp.okData(virtual);
    }
}
